package com.huifan.demo.revenue.servyou;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: liuchenhui
 * @create: 2019-08-13 20:27
 **/
public class SpecialProject {

    public static Object[] getRylb(String id, boolean xzzxxx) {
        if (xzzxxx) {
            return new Object[]{};
        }
        String ryxxfkztcx = ServyouService.ryxxfkztcx(id);
        System.out.println(ryxxfkztcx);

        JSONObject jsonObject = JSON.parseObject(ryxxfkztcx);
        String code = jsonObject.getString("code");
        String msg = jsonObject.getString("msg");
        JSONObject dataJson = jsonObject.getJSONObject("data");
        JSONArray bsjg = dataJson.getJSONArray("bsjg");
        Object[] dataObject = new Object[bsjg.size()];

        for (int i = 0; i < bsjg.size(); i++) {
            JSONObject object = bsjg.getJSONObject(i);
            String xm = object.getString("xm");
            String zzlx = object.getString("zzlx");
            String zzhm = object.getString("zzhm");

            // 企业单个员工的专项附加扣除明细
            Map<String, Object> qyry = new HashMap<>();
            qyry.put("xm", xm);
            qyry.put("zzlx", zzlx);
            qyry.put("zzhm", zzhm);

            // 子女教育专项列表

            //
        }
        return dataObject;
    }
}
